﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPivotGrid;
using System.Collections.Generic;
using DXApplicationTangche.UC.成品出库单.service;
using System.Data;
using DXApplicationTangche.Utils;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.UC.订单一览新.订单预览新.service;
using DXApplicationTangche.UC.订单一览新.辅料.service;
using DXApplicationTangche.UC.款式尺寸;
using mendian;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.货号管理.service;
using DXApplicationTangche.UC.项目流程.Service;
using DXApplicationTangche.UC.订单一览新.销售确认单;

namespace DXApplicationTangche.report
{
    public partial class XtraReport销售订单文件 : DevExpress.XtraReports.UI.XtraReport
    {
        private ViewCustomerDailyAdjustDTO viewCustomerDailyAdjustDTO = new ViewCustomerDailyAdjustDTO();
        public XtraReport销售订单文件(ViewCustomerDailyAdjustDTO viewCustomerDailyAdjustDTO)
        {
            InitializeComponent();
            this.viewCustomerDailyAdjustDTO = viewCustomerDailyAdjustDTO;
            this.BindData();
            this.BindTableData();
        }
        /// <summary>
        /// 绑定表头
        /// </summary>
        private void BindData()
        {
            this.xrTableCell客户姓名.Text = this.viewCustomerDailyAdjustDTO.customerName;
            this.xrTableCell电话.Text = this.viewCustomerDailyAdjustDTO.mobile;
            this.xrTableCell下单日期.Text = this.viewCustomerDailyAdjustDTO.orderDate.ToString("yyyy-MM-dd");
            this.xrTableCell总金额.Text = this.viewCustomerDailyAdjustDTO.price.ToString();
            this.xrTableCell整体调价.Text = this.viewCustomerDailyAdjustDTO.adjustPrice.ToString();
            this.xrTableCell最终金额.Text = (this.viewCustomerDailyAdjustDTO.price + this.viewCustomerDailyAdjustDTO.adjustPrice).ToString();

        }

        private void BindTableData()
        {
            this.xrTableCell数量.DataBindings.Add("Text", DataSource, "quantity");
            this.xrTableCell业务类型.DataBindings.Add("Text", DataSource, "businessType");
            this.xrTableCell款式名称.DataBindings.Add("Text", DataSource, "styleNameCn");
            this.xrTableCell面料号.DataBindings.Add("Text", DataSource, "materialCode");
            this.xrTableCell尺码.DataBindings.Add("Text", DataSource, "styleSizeCd");
            this.xrTableCell下单门店.DataBindings.Add("Text", DataSource, "storeName");
            this.xrTableCell销售员.DataBindings.Add("Text", DataSource, "assistantName");
            this.xrTableCell金额.DataBindings.Add("Text", DataSource, "price");
        }
    }

}
